<% layout( 'admin_layout') -%>

    <div id="wrapper" class="wrapper"></div>
    <header id="coverplan" class="main-header no-cover">
        <div class="vertical">
            <div class="main-header-content inner">
                <h1 class="page-title"><%=user.nickname%></h1>
                <h2 class="page-description"><%=user.description%></h2>
            </div>
        </div>
    </header>
    <section class="content-wrap">
        <div class="container">
            <div class="raw" id="bodycontent">
                <main id="content" class="main-content" role="main">
                    <div class="col-sm-12 usname">
                        <form class="form-horizontal" role="form">
                            <div class="form-group">
                                <%if(user.avatar == ''){%>

                                    <img id="avatar" src="/img/timg.jpg" class="img-circle" alt="Cinque Terre" width="150" height="150" style="float:left;">

                                    <%}else{%>
                                        <img id="avatar" src="<%=user.avatar%>" class="img-circle" alt="Cinque Terre" width="150" height="150" style="float:left;">
                                        <%}%>
                                            <div class="col-sm-6" style="margin-top:100px;">
                                                <input type="text" class="form-control" id="username">
                                                <span class="help-block">真实姓名能让大家更容易记住你</span>
                                            </div>
                            </div>
                        </form>
                    </div>

                    <div>
                        <form role="form" class="col-sm-offset-1 col-sm-7">
                            <div class="form-group">
                                <label for="usr">邮箱地址:</label>
                                <input type="email" class="form-control" id="email">
                                <span class="help-block">用于接收通知<span>
							</div>
							<div class="form-group">
								<label>位置:</label>
								<input type="text" class="form-control" id="local">
								<span class="help-block">你在哪儿？</span>
                            </div>
                            <div class="form-group">
                                <label>网站:</label>
                                <input type="url" class="form-control" id="blog">
                                <span class="help-block">还有其他的博客吗？告诉大家呀！</span>
                            </div>
                            <div class="form-group">
                                <label>简介:</label>
                                <textarea class="form-control" rows="5" id="description"></textarea>
                                <span class="help-block">介绍下你自己吧！不过不要太长哦！</span>
                            </div>
                            <hr/>
                        </form>
                    </div>
                </main>
            </div>
    </section>
    </div>
    <footer class="site-footer clearfix" style="margin-top:0px;">
        <section class="copyright">
            <a href="/" style="margin-bottom:0px;">
                <%=global.name%>
            </a> © 2016</section>
    </footer>
    <script>
        var menu = new Menu;

        $(function() {
            var avatar = "<%=user.avatar%>";
            var coverplan = "<%=user.coverplan%>";

            var username = "<%=user.nickname%>";
            var email = "<%=user.email%>";
            var local = "<%=user.local%>";
            var otherblog = "<%=user.otherblog%>";
            var description = "<%=user.description%>";

            $('#coverplan').css("background-image", "url(" + coverplan + ")");
            $('#avatar').attr('src', avatar);
            $('#username').val(username);
            $('#email').val(email);
            $('#local').val(local);
            $('#blog').val(otherblog);
            $('#description').val(description);

        });
    </script>